weight increased by one unit, the oil content in olives increased
units in this data set. This is consistent with what it has been
d in Figure 4.11.
Oil. content ൌ20 9.23 ൈStone. weight
(4.23)
erive regression statistics, the summary function was called
put was the model constructed by lm for the olive oil content
stat=summary(model)
statistics object (stat) contained the statistics include Rଶ and the
c p value. Rଶ for this data was 0.1962. It was accessed using the
g code,
stat$r.squared
F-statistic p value was 0.000155. Therefore, the null hypothesis
0 was rejected. This statistics object contained a coefficient
which was obtained by using the following code,
coef=data.frame(coefficients(stat))
egression coefficient p value was 0.000155, the null hypothesis
ߚ= 0 was thus rejected. The access to the regression coefficient p
n be made using coef$Pr[2], where [2] pointed to the second
e coefficient matrix or the second entry of the p value vector,
onfidence bands were obtained by calling the predict function.
lling this function, the first input was the regression model
ed by lm and the parameter interval was specified as
ence,
nds=predict(model,interval=‘confidence’)
e 4.13 shows the regression model where the solid line is the
d regression function for the data and the dashed lines are the
ce bands.